﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DBTools.DBUpdate.Comm
{
    public class Set
    {
        #region 运行目录
        static string _SelectFolder = "";

        public static string SelectFolder
        {
            get { return Set._SelectFolder; }
            set { Set._SelectFolder = value; }
        }

        static string _TempFolder = System.IO.Path.GetTempPath();//返回x:\xxx\temp\

        public static string TempFolder
        {
            get { return Set._TempFolder; }
            set { Set._TempFolder = value; }
        }
        #endregion


        


        #region 其它变量
        static string _DbServerConnectionString = "";

        public static string DbServerConnectionString
        {
            get { return Set._DbServerConnectionString; }
            set { Set._DbServerConnectionString = value; }
        }

        static int _DbConnectionTimeOut = 120;

        public static int DbConnectionTimeOut
        {
            get { return Set._DbConnectionTimeOut; }
            set { Set._DbConnectionTimeOut = value; }
        }
        

        static string _DataBaseName = "";//数据库名

        public static string DataBaseName
        {
            get { return Set._DataBaseName; }
            set { Set._DataBaseName = value; }
        }
        static string _SystempName = "";//系统名称

        public static string SystempName
        {
            get { return Set._SystempName; }
            set { Set._SystempName = value; }
        }

        static string _ServerIp = "";

        public static string ServerIp
        {
            get { return Set._ServerIp; }
            set { Set._ServerIp = value; }
        }
        static string _UserName = "";

        public static string UserName
        {
            get { return Set._UserName; }
            set { Set._UserName = value; }
        }
        static string _PassWord = "";

        public static string PassWord
        {
            get { return Set._PassWord; }
            set { Set._PassWord = value; }
        }


        static List<string> _SqlExction = new List<string>() { ".U"};
        #endregion


    }
    public class MessageComm
    {
        public static DialogResult ShowError(string MsgText, string Title = "错误")
        {
            return MessageBox.Show(MsgText, Title, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        public static DialogResult ShowWarning(string MsgText, string Title = "警告")
        {
            return MessageBox.Show(MsgText, Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
        public static DialogResult ShowInfo(string MsgText, string Title = "提示")
        {
            return MessageBox.Show(MsgText, Title, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        public static DialogResult ShowYesOrNo(string MsgText, string Title = "提示")
        {
            return MessageBox.Show(MsgText, Title, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }
    }

    public enum DBType
    {
        Mssql = 0,
        Oracle = 1
    }

}
